<!DOCTYPE html>
<html lang="en"
      xmlns="http://www.w3.org/1999/xhtml"
      xmlns:th="http://www.thymeleaf.org">
<div th:replace="common/header::header('我的考试')"></div>
<body>
<div id="wrapper" class="row">
    <div th:replace="common/header::nav"></div>
    <div id="page-inner">
        <!--我的考试存在时显示-->
        <th:block th:if="${#lists.size(myExam)>0}" th:switch="${myExam[0].pay}">
            <!--待缴费-->
            <div class="row" th:case="0">
                <div class="col-md-12">
                    <div class="table-responsive">
                        <table class="table table-striped table-bordered table-hover">
                            <thead>
                            <tr>
                                <th>考试名称</th>
                                <th>考试时间</th>
                                <th>操作</th>
                            </tr>
                            </thead>
                            <tbody>
                            <th:block th:each="e:${myExam}">
                            <tr th:object="${e.exam}">
                                <td th:text="*{name}">1</td>
                                <td th:text="*{#dates.format(time, 'yyyy-MM-dd HH:mm')}">2018-5-4</td>
                                <td><a th:href="'/erems/examinee/continuePay?id='+*{id}">继续支付</a></td>
                            </tr>
                            </th:block>
                            </tbody>
                        </table>
                    </div>
                </div>
            </div>
            <!-- /. ROW  -->
            <!--已缴费-->
            <div class="row" th:case="1">
                <!--未考试已缴费-->
                <div class="col-md-12" th:if="${myExam[0].score < 0}">
                    <div class="table-responsive">
                        <table class="table table-striped table-bordered table-hover">
                            <thead>
                            <tr>
                                <th>考试名称</th>
                                <th>考试时间</th>
                                <th>准考证号</th>
                                <th>状态</th>
                                <th>操作</th>
                            </tr>
                            </thead>
                            <tbody>
                            <th:block th:each="e:${myExam}">
                            <tr th:object="${e.exam}">
                                <td th:text="*{name}">1</td>
                                <td th:text="*{#dates.format(time, 'yyyy-MM-dd HH:mm')}">2018-5-4</td>
                                <td th:text="${e.examNum}">100</td>
                                <td>
                                    <th:block  th:if="${e.examNum!=null&&e.examNum!=''}">准考证已生成</th:block>
                                    <th:block  th:unless="${e.examNum!=null&&e.examNum!=''}">等待准考证生成</th:block>
                                </td>
                                <td><a th:href="'/erems/show-doc?id='+${e.id}" th:if="${e.examNum!=null&&e.examNum!=''}">下载准考证</a></td>
                            </tr>
                            </th:block>
                            </tbody>
                        </table>
                    </div>
                </div>
                <!--已考试-->
                <div class="col-md-12" th:if="${myExam[0].score >= 0}">
                    <div class="table-responsive">
                        <table class="table table-striped table-bordered table-hover">
                            <thead>
                            <tr>
                                <th>考试名称</th>
                                <th>考试时间</th>
                                <th>准考证号</th>
                                <th>分数</th>
                                <th>状态</th>
                            </tr>
                            </thead>
                            <tbody>
                            <th:block th:each="e:${myExam}">
                            <tr th:object="${e.exam}">
                                <td th:text="*{name}">1</td>
                                <td th:text="*{#dates.format(time, 'yyyy-MM-dd HH:mm')}">2018-5-4</td>
                                <td th:text="${e.examNum}">100</td>
                                <td th:text="${e.score}">100</td>
                                <td>已考试</td>
                            </tr>
                            </th:block>
                            </tbody>
                        </table>
                    </div>
                </div>
            </div>
            <!-- /. ROW  -->
        </th:block>
        <!--我的考试不存在时显示-->
        <th:block th:unless="${#lists.size(myExam)>0}">
            <div class="row">
                <div class="col-md-12">
                    <div class="table-responsive">
                        <table class="table table-striped table-bordered table-hover">
                            <thead>
                            <tr>
                                <th>未查询到相应考试信息！</th>
                            </tr>
                            </thead>
                        </table>
                    </div>
                </div>
            </div>
            <!-- /. ROW  -->
        </th:block>
    </div>
    <!-- /. PAGE INNER  -->
</div>
<!-- /. WRAPPER  -->

<div th:replace="common/footer"></div>
</body>
</html>